<!DOCTYPE html>
<html>
<head>
    <title>弹出</title>

    <script type="text/javascript" src="./static/js/common/jquery-1.10.1.min.js"></script>

  <script type="text/javascript" src="./static/js/common/jquery-2.2.4.min.js"></script>



  <!-- Add fancyBox main JS and CSS files -->
  <link rel="stylesheet" type="text/css" href="./static/css/jquery.fancybox.css"/>



  <link href='./static/css/fullcalendar.css' rel='stylesheet' />


  <script src='./static/js/common/moment.min.js'></script>
  <script src='./static/js/cal/fullcalendar.min.js'></script>

  <script type="text/javascript" src="./static/js/common/jquery.fancybox.js"></script>


    <script src="./static/js/common/jquery.min.js"></script>

    <link  rel="stylesheet" href="./static/css/jquery-ui.min.css"/>

    <link rel="stylesheet" href="./static/css/main.css" />

    <script src="./static/js/common/jquery-ui.js"></script>
    <script src="./static/js/common/jquery.form.min.js"></script>
    <style>


        .fancy{width:450px; height:auto}
        .fancy h3{height:30px; line-height:30px; border-bottom:1px solid #d3d3d3; font-size:14px}
        .fancy form{padding:10px}
        .fancy p{height:28px; line-height:28px; padding:4px; color:#999}
        .input{height:20px; line-height:20px; padding:2px; border:1px solid #d3d3d3; width:100px}
        .btn{-webkit-border-radius: 3px;-moz-border-radius:3px;padding:5px 12px; cursor:pointer}
        .btn_ok{background: #360;border: 1px solid #390;color:#fff}
        .btn_cancel{background:#f0f0f0;border: 1px solid #d3d3d3; color:#666 }
        .btn_del{background:#f90;border: 1px solid #f80; color:#fff }
        .sub_btn{height:32px; line-height:32px; padding-top:6px; border-top:1px solid #f0f0f0; text-align:right; position:relative}
        .sub_btn .del{position:absolute; left:2px}
    </style>
</head>

<script>
</script>
<body>
<div class="fancy">


    <div class="fancy">
        <h3>编辑事件</h3>
        <form id="add_form" action="do.php?action=edit" method="post">
            <input type="hidden" name="id" id="eventid" value="10651">
            <p>日程内容：<input type="text" class="input" name="event" id="event" style="width:320px"
                           placeholder="记录你将要做的一件事..." value="222222222222222"></p>
            <p>开始时间：<input type="text" class="" name="startdate" id="startdate"
                           value="2016-04-27" >
     <span id="sel_start" style="display:none">
        <select name="s_hour">
    	<option value="00" selected="">00</option>
    	<option value="00">00</option>
        <option value="01">01</option>
        <option value="02">02</option>
        <option value="03">03</option>
        <option value="04">04</option>
        <option value="05">05</option>
        <option value="06">06</option>
        <option value="07">07</option>
        <option value="08">08</option>
        <option value="09">09</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>
        <option value="22">22</option>
        <option value="23">23</option>
    </select>:
    <select name="s_minute">
    	<option value="00" selected="">00</option>
    	<option value="00">00</option>
        <option value="10">10</option>
        <option value="20">20</option>
        <option value="30">30</option>
        <option value="40">40</option>
        <option value="50">50</option>
    </select>
    </span>
            </p>
            <p id="p_endtime" style="display:none">结束时间：<input type="text" class="input datepicker hasDatepicker"
                                                               name="enddate" id="enddate" value="" readonly="">
    <span id="sel_end" style="display:none"><select name="e_hour">
    	<option value="" selected=""></option>
    	<option value="00">00</option>
    	<option value="01">01</option>
        <option value="02">02</option>
        <option value="03">03</option>
        <option value="04">04</option>
        <option value="05">05</option>
        <option value="06">06</option>
        <option value="07">07</option>
        <option value="08">08</option>
        <option value="09">09</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>
        <option value="22">22</option>
        <option value="23">23</option>
    </select>:
    <select name="e_minute">
    	<option value="" selected=""></option>
    	<option value="00">00</option>
        <option value="10">10</option>
        <option value="20">20</option>
        <option value="30">30</option>
        <option value="40">40</option>
        <option value="50">50</option>
    </select>
    </span>
            </p>
            <p>
                <label><input type="checkbox" value="1" id="isallday" name="isallday" checked="">禁用</label>
                <label><input type="checkbox" value="1" id="isend" name="isend"> 启用</label>
            </p>
            <div class="sub_btn"><span class="del"><input type="button" class="btn btn_del" id="del_event"
                                                          value="删除"></span><input type="submit" class="btn btn_ok"
                                                                                   value="确定"> <input type="button"
                                                                                                      class="btn btn_cancel"
                                                                                                      value="取消"
                                                                                                      onclick="$.fancybox.close()">
            </div>
        </form>
    </div>
</div>

<script>


    $(function(){
        $("#startdate").datepicker();
        $("#isallday").click(function(){
            if($("#sel_start").css("display")=="none"){
                $("#sel_start,#sel_end").show();
            }else{
                $("#sel_start,#sel_end").hide();
            }
        });

        $("#isend").click(function(){
            if($("#p_endtime").css("display")=="none"){
                $("#p_endtime").show();
            }else{
                $("#p_endtime").hide();
            }
            $.fancybox.resize();//调整高度自适应
        });

        //提交表单
        $('#add_form').ajaxForm({
            beforeSubmit: showRequest, //表单验证
            success: showResponse //成功返回
        });
    });

    function showRequest(){
        var events = $("#event").val();
        if(events==''){
            alert("请输入日程内容！");
            $("#event").focus();
            return false;
        }
    }

    function showResponse(responseText, statusText, xhr, $form){
        if(statusText=="success"){
            if(responseText==1){
                $.fancybox.close();
                $('#calendar').fullCalendar('refetchEvents'); //重新获取所有事件数据
            }else{
                alert(responseText);
            }
        }else{
            alert(statusText);
        }
    }
</script>
</body>


</html>
